<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <title>${facility.name} Attributes</title>
  </head>
  <body>
    
    <div data-role="page">
      
       <div data-role="header">
                <!--<a href="<g:createLinkTo dir="/"/>"><img id="logo" src="${createLinkTo(dir: 'images', file: 'smallcross.png')}" alt="healththink logo"/></a>-->
                <d>HealthThink</d>
       </div>
      
      <div data-role="content" >
        <h2>${facility.name} Attributes</h2>
        <table>
          <g:each var="name" in="${facilityAttributeNames}">
            <tr>
              <td align="right">
                <g:form controller="attribute" action="view">
                  <g:hiddenField name="name" value="${name}"/>
                  <g:submitButton name="button" value="${name}"/>
                </g:form>
              </td>
              <td style="padding-left: 10px">
                <g:form action="removeAttribute">
                  <g:hiddenField name="name" value="${facility.name}"/>
                  <g:hiddenField name="attrName" value="${name}"/>
                  <g:submitButton name="remove" data-icon="delete" data-iconpos="notext"/>
                </g:form>
              </td>
            </tr>
          </g:each>
        </table>
        <br /><br />
        <g:form action="view">
          <g:hiddenField name="name" value="${facility.name}"/>
          <g:submitButton name="page" value="Facility" data-icon="back"/>
        </g:form>
        
          <h2 align="left">Other Attributes</h2>
          <table align="left">
            <g:each var="name" in="${attributeNames}">
              <tr>
                <td align="right">
                  <g:form controller="attribute" action="view">
                    <g:hiddenField name="name" value="${name}"/>
                    <g:submitButton name="button" value="${name}"/>
                  </g:form>
                </td>
                <td style="padding-left: 10px">
                  <g:form action="addAttribute">
                    <g:hiddenField name="name" value="${facility.name}"/>
                    <g:hiddenField name="attrName" value="${name}"/>
                    <g:submitButton name="add" data-icon="plus" data-iconpos="notext"/>
                  </g:form>
                </td>
              </tr>
            </g:each>
          </table>
          <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />


          <g:form controller="attribute" action="createNew">
            <g:hiddenField name="name" value="${facility.name}"/>
            <g:submitButton name="create" value="New Attribute" data-mini="true" data-icon="plus"/>
          </g:form>
      </div>
      
      <div data-role="footer">
                    <p><h4>HealthThink</h4></p>
      </div>
  
  </body>
</html>
